<template>
    <div>
        <h3>编辑列表</h3>

        <thead>
            <table>
                <tr>
                    <td>编号</td>
                    <td>名称</td>
                    <td>性别</td>
                    <td>生日</td>
                    <td>地址</td>
                    <td>操作</td>
                </tr>
            </table>
            <tbody >
                <tr v-for=" a in data">
                    <td>{{ a.Eid }}</td>
                    <td>{{ a.Ename }}</td>
                    <td>{{ a.Esex==1?"女":"男" }}</td>
                    <td>{{moment( a.Ebirthday).format("YYYY-MM-DD") }}</td>
                    <td>{{a.Eaddr}}</td>
                </tr>
            </tbody>
        </thead>
    </div>
</template>

<script setup lang="ts">

import { ref,onMounted } from "vue"
import axios from "axios"
import { useRoute } from "vue-router"
import moment from "moment";

const router=useRoute();

const data=ref([{
        "Eid": 0,
        "Ename": "",
        "Esex": 0,
        "Ebirthday": "",
        "Eaddr": ""
  }])

const getdata=()=>{
    var vid=router.query.id;
    axios.post("https://localhost:7013/api/Emp/Update",{params:{id:vid}}).then(res=>{
        data.value=res.data;
    })
}

onMounted(()=>{
    getdata()
})


</script>

<style scoped>

</style>